<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>物业收费明细</title>
<LINK href="images/css.css" type="text/css" rel="stylesheet">
<style type="text/css" media="print">
.noprint {
	display: none;
}
</style>
<script type="text/javascript">
	 
</script>
</head>

<body>
<table width="100%" height="420" border="0" align="center">
<tr valign="middle"><td>
<table width="100%" border="0">
	<tr align="center">
		<td>
			<strong><font size="+2">湖北康正物业服务有限公司物业收费通知单</font></strong>
		</td>
	</tr>
	<tr>
		<td>
		<table width="100%" border="1" align="right" cellpadding="0"
			cellspacing="0" bordercolor="#000000">
			<tr align="center">
				<td><b>小区名称</b></td>
				<td><b>${bill.house.building.subDistrict.name}&nbsp;</b></td>
				<td><b>房产编号</b></td>
				<td><b>${bill.house.houseId }&nbsp;</b></td>
				<td><b>业主</b></td>
				<td><b>${bill.house.owner.name }&nbsp;</b></td>
				<td><b>缴费月份</b></td>
				<td><b>
				<c:choose>
		      		<c:when test="${bill.year eq 0 and bill.month eq 0 }">历史欠费&nbsp;</c:when>
		      		<c:otherwise>${bill.year }年${bill.month }月&nbsp;</c:otherwise>
	      		</c:choose>
				</b></td>
			</tr>
			<tr align="center">
				<td width="18%"><b>收费项目</b></td>
				<td width="12%"><b>起码数</b></td>
				<td width="12%"><b>止码数</b></td>
				<td width="18%"><b>数量(平米/度/吨)</b></td>
				<td width="13%"><b>收费标准(元)</b></td>
				<td width="13%"><b>金额(元)</b></td>
				<td colspan="2" align="center"><b>备注</b></td>
			</tr>
			<c:if test="${!empty recordList}">
				<c:forEach items="${recordList}" var="record">
					<tr>
						<td>
						<c:choose>
							<c:when test="${record.chargeItem.itemId eq '2'}">
							&nbsp;物业服务费
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '3' and power2Volume ne 0 and isHistoryBill eq 0}">
							&nbsp;电费1
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '4' and water2Volume ne 0 and isHistoryBill eq 0}">
							&nbsp;水费1
							</c:when>							
							<c:otherwise>
							&nbsp;${record.chargeItem.name }
							</c:otherwise>
						</c:choose>
						</td>
						<c:choose>
							<c:when test="${record.chargeItem.itemId eq '1'}">
								<td align="right">&nbsp;</td>
								<td align="right">&nbsp;</td>
								<td align="right" height="25">
									<fmt:formatNumber value="${bill.house.area }" pattern="0.00" />&nbsp;
								</td>
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '2'}">
								<td align="right">&nbsp;</td>
								<td align="right">&nbsp;</td>
								<td align="right" height="25">1.00&nbsp;</td>
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '3'}">
								<td align="right">${powerBegin }&nbsp;</td>
								<td align="right">${powerEnd }&nbsp;</td>
								<td align="right" height="25">${powerVolume }&nbsp;</td>
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '4'}">
								<td align="right">${waterBegin }&nbsp;</td>
								<td align="right">${waterEnd }&nbsp;</td>
								<td align="right" height="25">${waterVolume }&nbsp;</td>
							</c:when>
							<c:when test="${record.chargeItem.itemId eq '8'}">
								<td align="right">${waterBegin }&nbsp;</td>
								<td align="right">${waterEnd }&nbsp;</td>
								<td align="right" height="25">${waterVolume }&nbsp;</td>
							</c:when>
							<c:otherwise>
								<td align="right">&nbsp;</td>
								<td align="right">&nbsp;</td>
								<td align="right" height="25">1&nbsp;</td>
							</c:otherwise>
						</c:choose>
						<td align="right">
							<fmt:formatNumber value="${record.chargeCriterion.amount }" pattern="0.00" />&nbsp;
						</td>
						<td align="right">
							<c:choose>
								<c:when test="${record.chargeItem.itemId eq '3' and power2Volume ne 0 and isHistoryBill eq 0}"><fmt:formatNumber value="${record.chargeCriterion.amount * powerVolume }" pattern="#.00" />&nbsp;</c:when>
								<c:when test="${record.chargeItem.itemId eq '4' and water2Volume ne 0 and isHistoryBill eq 0}"><fmt:formatNumber value="${record.chargeCriterion.amount * waterVolume }" pattern="#.00" />&nbsp;</c:when>
								<c:otherwise><fmt:formatNumber value="${record.wantMoney }" pattern="#.00" />&nbsp;</c:otherwise>
							</c:choose>
						</td>
						<td colspan="2">&nbsp;<c:if test="${(record.chargeItem.itemId eq '1' or record.chargeItem.itemId eq '2') and isPreCharged eq 1 }"><font color="red">已预收物业费</font></c:if></td>
					</tr>
					<c:if test="${record.chargeItem.itemId eq '3' and power2Volume ne 0 and isHistoryBill eq 0}">
					<tr>
						<td>&nbsp;电费2</td>
						<td align="right">${power2Begin }&nbsp;</td>
						<td align="right">${power2End }&nbsp;</td>
						<td align="right" height="25">${power2Volume }&nbsp;</td>
						<td align="right"><fmt:formatNumber value="${record.chargeCriterion.amount }" pattern="0.00" />&nbsp;</td>
						<td align="right"><fmt:formatNumber value="${record.chargeCriterion.amount * power2Volume }" pattern="#.00" />&nbsp;</td>
						<td colspan="2">&nbsp;</td>						
					</tr>
					</c:if>
					<c:if test="${record.chargeItem.itemId eq '4' and water2Volume ne 0 and isHistoryBill eq 0}">
					<tr>
						<td>&nbsp;水费2</td>
						<td align="right">${water2Begin }&nbsp;</td>
						<td align="right">${water2End }&nbsp;</td>
						<td align="right" height="25">${water2Volume }&nbsp;</td>
						<td align="right"><fmt:formatNumber value="${record.chargeCriterion.amount }" pattern="0.00" />&nbsp;</td>
						<td align="right"><fmt:formatNumber value="${record.chargeCriterion.amount * water2Volume }" pattern="#.00" />&nbsp;</td>
						<td colspan="2">&nbsp;</td>						
					</tr>
					</c:if>					
				</c:forEach>
			</c:if>
			<tr>
				<td align="center">合计</td>
				<td align="left" colspan="4">&nbsp;(大写)&nbsp;&nbsp;&nbsp;${amountUpperCase }</td>
				<td align="right">(小写)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<fmt:formatNumber value="${bill.amount }" pattern="#.00" />&nbsp;
				</td>
				<td colspan="2">&nbsp;<c:if test="${isPreCharged eq 1 }"><font color="red">应收：<fmt:formatNumber value="${bill.amount - wantMoney }" pattern="#.00" />元</font></c:if></td>
			</tr>
		</table>
		</td>
	</tr>
</table>

<div id="printDiv" class="noprint"
	style="text-align: right; margin-top: 10px; margin-right: 10px; font-size: 14px;">
	<a href="#" onclick="javascript:window.print()">打印明细</a> |
	<a href="bill.do?method=pay&id=${bill.id }&isPreCharged=${isPreCharged }&wantMoney=${wantMoney }">账单支付</a>
</div>
</td>
</tr>
</table>
</body>
</html>